package reflect;

import reflect.ann.Test;

import java.lang.reflect.Method;

public class ReflectDemo10 {
    public static void main(String[] args) throws Exception{
        /**
         * 获取方法上的注解，和注解的属性值
         */
        Class cls = Class.forName("reflect.TestCase");
        Method[] methods = cls.getDeclaredMethods();
        for (Method method:methods){
            Test ano = method.getAnnotation(Test.class);
            //ano.order() 获取属性值
            int value = ano.order();
            System.out.println(value);
        }
    }
}
